import {
    VIDEO_SET_DATA, WORKS_SET_DATA, COMMENT_DATA, WORKLIKE_DATA
} from './../action/actionType';

export let video = (state = {
    videoData: null,
    worksData: null,
    commentData: null,
    workLikeData: null,
}, action) => {
    let {
        type
    } = action;
    let newState = {
        ...state
    };
    switch (type) {
        case VIDEO_SET_DATA:
            newState.videoData = action.obj;
            return newState
            break;
        case WORKS_SET_DATA:
            newState.worksData = action.data;
            return newState
            break;
        case COMMENT_DATA:
            newState.commentData = action.data;
            return newState
            break;
        case WORKLIKE_DATA:
            newState.workLikeData = action.data;
            return newState
            break;
        default:
            return newState
            break;
    }
}